package com.google.jessewilson.codesearch.intellij;

import com.google.inject.Guice;
import com.google.inject.Injector;

/**
 * Bootstrap singleton, the source of the Guice injector.
 *
 * @author jessewilson
 */
public class CodeSearchInjector {

  private static Injector injector;

  public static synchronized void inject(Object o) {
    if (injector == null) {
      injector = Guice.createInjector(new IntellijModule());
    }

    injector.injectMembers(o);
  }
}
